<?php
/*
 * Copyright 2011 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * The Prediction service implementation
 *
 * Generated by http://code.google.com/p/google-api-php-client/
 * Generated from: https://www.googleapis.com/discovery/v0.3/describe/prediction/v1.1
 **/
class Output {
  public $kind;
  public $outputLabel;
  public $outputMulti;
  public $outputValue;
}

class PredictionPredictRequest {
  public $input;
}

class PredictionPredictRequestInput {
  public $mixture;
  public $numeric;
  public $text;
}

class PredictionTrainingGet {
  public $data;
  public $modelinfo;
}

class PredictionTrainingInsert {
  public $data;
}

class apiPredictionService {

  // Variables that the apiServiceResource implementation depends on
  private $serviceName = 'prediction';
  private $version = 'v1.1';
  private $restBasePath = '/prediction/v1.1/';
  private $rpcPath = '/rpc';
  private $io;
  // apiServiceResource's that are used internally
  private $training;

  /**
   * Constructs the internal service representations and does the auto-magic configuration required to drive them
   */
  public function __construct(apiClient $apiClient) {
    $apiClient->addService('prediction', 'v1.1');
    $this->io = $apiClient->getIo();
    $this->training = new apiServiceResource($this, $this->serviceName, 'training', json_decode('{"methods":{"delete":{"restPath":"training\/{data}","rpcMethod":"prediction.training.delete","httpMethod":"DELETE","description":"Delete a trained model","parameters":{"data":{"restParameterType":"path","required":true,"description":"mybucket%2Fmydata resource in Google Storage","type":"string"}},"parameterOrder":["data"],"scopes":["https:\/\/www.googleapis.com\/auth\/prediction"]},"get":{"restPath":"training\/{data}","rpcMethod":"prediction.training.get","httpMethod":"GET","description":"Check training status of your model","parameters":{"data":{"restParameterType":"path","required":true,"description":"mybucket%2Fmydata resource in Google Storage","type":"string"}},"parameterOrder":["data"],"response":{"$ref":"PredictionTrainingGet"},"scopes":["https:\/\/www.googleapis.com\/auth\/prediction"]},"insert":{"restPath":"training","rpcMethod":"prediction.training.insert","httpMethod":"POST","description":"Begin training your model","parameters":{"data":{"restParameterType":"query","required":true,"description":"mybucket%2Fmydata resource in Google Storage","type":"string"}},"parameterOrder":["data"],"request":{"$ref":"PredictionTrainingInsert"},"response":{"$ref":"PredictionTrainingInsert"},"scopes":["https:\/\/www.googleapis.com\/auth\/prediction"]}}}', true));
  }

  /**
   * Delete a trained model
   *
   * @param $data   string mybucket%2Fmydata resource in Google Storage
   */
  public function deleteTraining($data) {
    return $this->training->__call('delete', array(array('data' => $data)));
  }

  /**
   * Check training status of your model
   *
   * @param $data   string mybucket%2Fmydata resource in Google Storage
   */
  public function getTraining($data) {
    return $this->training->__call('get', array(array('data' => $data)));
  }

  /**
   * Begin training your model
   *
   * @param $data   string mybucket%2Fmydata resource in Google Storage
   * @param $postBody 
   */
  public function insertTraining($data,
        $postBody) {
    return $this->training->__call('insert', array(array('data' => $data,
        'postBody' => $postBody)));
  }

  /**
   * @return the $io
   */
  public function getIo() {
    return $this->io;
  }

  /**
   * @return the $version
   */
  public function getVersion() {
    return $this->version;
  }

  /**
   * @return the $restBasePath
   */
  public function getRestBasePath() {
    return $this->restBasePath;
  }

  /**
   * @return the $rpcPath
   */
  public function getRpcPath() {
    return $this->rpcPath;
  }
}

